<?php /*a:2:{s:45:"D:\www\long_shop\app\view\menu\menu_edit.html";i:1702389679;s:42:"D:\www\long_shop\app\view\common\head.html";i:1702389678;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="/static/jquery/jquery-1.12.4.min.js"></script>    
    <link href="/static/bst5.3.2/css/bootstrap.min.css" rel="stylesheet">
    <script src="/static/bst5.3.2/js/bootstrap.bundle.min.js"></script>
    <link rel="stylesheet" href="/static/bst-icons/font/bootstrap-icons.css">
    <script src="/static/layer/layer/layer.js"></script>
    <link rel="stylesheet" href="/static/css/my.css">    
</head>
<head>
<title>菜单项编辑</title>
    <style type="text/css">
      .group_item{padding:0px 4px;margin:5px;border:1px solid #666;border-radius: 4px;width:max-content;display:inline-block;}
    </style>
</head>
<body style="">
    <div class="container p-3 my-3 " style="max-width: 600px;" >
    <h2>菜单项编辑</h2>
    <form method="post" action="/index.php/menu/edit">

      <input type="hidden" name="id" id="id" value="<?php echo htmlentities($data['id']); ?>" />

      <div class="mb-3 mt-3">
        <lable for="fid" class="form-label">父级菜单(Categray):</label>
        <select id="fid" name="fid" class="form-control">
            <?php foreach($top_menu as $k=>$v): if($k==$data['fid']): ?>
                    <option value="<?php echo htmlentities($k); ?>" selected ><?php echo htmlentities($v['name']); ?></option>
                <?php else: ?>
                    <option value="<?php echo htmlentities($k); ?>" ><?php echo htmlentities($v['name']); ?></option>
                <?php endif; ?>
            <?php endforeach; ?>
        </select>
      </div>
      <div class="mb-3 mt-3">
        <lable for="name" class="form-label">菜单项名称(Name):</label>
        <input type="text" class="form-control" id="name" name="name" value="<?php echo htmlentities($data['name']); ?>" placeholder="Goods name" />
      </div>
      <div class="mb-3 mt-3">
        <lable for="url_key" class="form-label">关键字(Keyword):</label>
        <input type="text" class="form-control" id="url_key" name="url_key" value="<?php echo htmlentities($data['url_key']); ?>" placeholder="Keyword" />
      </div>          
      <div class="mb-3">
        <label for="title" class="form-label">说明(Title):</label>
        <input type="text" class="form-control" id="title" name="title" value="<?php echo htmlentities($data['title']); ?>" placeholder="Title" />
      </div>

      <div class="mb-3">
        <label for="status" class="form-label">是否启用(Using):</label>
          <input type="radio" class="form-check-input" id="radio1" name="status" value="1" <?php if($data['status']==1): ?> checked <?php endif; ?>/> 
          <label class="form-check-label" for="radio1">启用(Using)</label>
          <input type="radio" class="form-check-input" id="radio2" name="status" value="2" <?php if($data['status']==2): ?> checked <?php endif; ?>/>
          <label class="form-check-label" for="radio2">停用(Stoped)</label>
       </div>
      <div class="mb-3">
        <label for="status" class="form-label">权限组:</label>
          <?php echo $g_html; ?>
       </div>


      <button  type="button" class="btn btn-primary" onclick="doSave()">保存(Save)</button>

    </form>
    </div>

<script type="text/javascript">


    function doSave(){
      if(!$("#name").val()) {
        layer.msg("无效的名称(Invalid name)!");
        return 0;
      }    
      //询问框
      layer.confirm('是否确定保存?', {
        btn: ['YES','CANCEL'] //按钮
      }, function(){
        $('form').submit();
      }, function(){
        layer.msg("Cancel!");
        return 0;
      });
    }

</script>


</body>
</html>
